package com.hup.minicontroller.common.framework;

import android.content.SharedPreferences;

import androidx.annotation.Nullable;

/**
 * @author hugan
 * @date 2022/6/11
 */
public class SpUtil {

    /**
     * 异步写入
     */
    public static void apply(SharedPreferences sp, String key, boolean obj) {
        sp.edit().putBoolean(key, obj).apply();
    }

    public static void apply(SharedPreferences sp, String key, int obj) {
        sp.edit().putInt(key, obj).apply();
    }

    public static void apply(SharedPreferences sp, String key, @Nullable String obj) {
        sp.edit().putString(key, obj).apply();
    }

}
